﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace MiniPac.Components
{
	class Path : IComparable
	{
		public Point start;
		public int lenght;
		public Dir dir;

		public Path(int l, Point s, Dir d)
		{
			start = s;
			lenght = l;
			dir = d;
		}

		public String ToString()
		{
			return "(" + lenght.ToString() + ")";
		}

		public static bool operator ==(Path a, Path b)
		{
			if (System.Object.ReferenceEquals(a, b))
			{
				return true;
			}

			if (((object)a == null) || ((object)b == null))
			{
				return false;
			}

			return a.lenght == b.lenght;
		}

		public static bool operator !=(Path a, Path b)
		{
			return !(a == b);
		}

		public static bool operator <(Path a, Path b)
		{
			return a.lenght < b.lenght;
		}

		public static bool operator >(Path a, Path b)
		{
			return a.lenght > b.lenght;
		}

		public static bool operator <=(Path a, Path b)
		{
			return a.lenght <= b.lenght;
		}

		public static bool operator >=(Path a, Path b)
		{
			return a.lenght >= b.lenght;
		}

		#region Implementation of IComparable

		public int CompareTo(object obj)
		{
			return this.lenght.CompareTo(((Path) obj).lenght);
		}

		#endregion
	}
}
